package com.chapter.Demo06;

import java.util.Calendar;

public class Demo03 {
    public static void main(String[] args) {
        Calendar calendar = Calendar.getInstance();
        int year = calendar.get(Calendar.YEAR);
        int moth = calendar.get(Calendar.MONTH);
        int day = calendar.get(Calendar.DAY_OF_MONTH);
        System.out.println(year+"年"+(moth+1)+"月"+day+"日");
        Calendar calendar2 =Calendar.getInstance();
        calendar2.set(Calendar.DAY_OF_MONTH,5);
        System.out.println(calendar2.getTime());
        calendar2.add(Calendar.HOUR,1);
        System.out.println(calendar2.getTime());

    }
}
